@extends('admin.layout.index')
@section('content')

    <div class="mws-panel grid_8">
        <div class="mws-panel-header">
            <span><i class="icon-table"></i> Simple Table</span>
        </div>
        <div class="mws-panel-body no-padding">
            <table class="mws-table">
                <thead>
                <tr>
                    <th>订单id</th>
                    <th>订单号</th>
                    <th>订单人</th>
                    <th>操作</th>

                </tr>
                </thead>
                <tbody>
                @foreach($data as $k=>$v)
                <tr align="center">
                    <td>{{$v['oid']}}</td>
                    <td>{{$v['onumber']}}</td>
                    <td>{{$v['user']['uname']}}</td>
                    <td>  <a href="/admin/order/delete/{{$v['oid']}}">删除</a>

                        <a href="javascript:void(0);" onClick="delClick({{$v['oid']}});">查看订单详情</a>
                    </td>

                </tr>
                    @endforeach

                </tbody>
            </table>
            <div id="page_page" class="">
                {!! $data->appends($request)->render()!!}
            </div>
        </div>
    </div>

    <script type="text/javascript">

        function delClick(oid){

            $.get('/admin/order/info',{'oid':oid },
                function(msg){

                    layer.open({
                        type: 1,
                        skin: 'layui-layer-rim', //加上边框
                        area: ['500px', '300px'], //宽高


                        content: msg
                    });
                }

            );

//            layer.confirm('是否确定删除', {
//                btn: ['是','否'] //按钮
//            }, function(){
//                $.ajaxSetup({
//                    headers: {
//                        'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
//                    }
//                });
//
//                $.post('/home/address/del',{'bid':bid },
//                    function(msg){
//                        if(msg){
//                            layer.msg('删除成功', {icon: 1});
//                            window.location.href = "/home/address";
//                        }
//                    }
//                );
//
//            }, function(){
//
//            });
        }

    </script>
    @endsection